package com.service.impl;

import com.bean.Movie;
import com.dao.MovieMapper;
import com.service.MovieService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Component
@Service
public class MovieServiceImpl implements MovieService {
    @Autowired
    private MovieMapper movieMapper;
    @Override
    public int save(Movie movie) {
        return movieMapper.insert(movie);
    }

    @Override
    public int remove(Movie movie) {
        return movieMapper.delete(movie);
    }

    @Override
    public int modify(Movie movie) {
        return movieMapper.update(movie);
    }

    @Override
    public List<Movie> find(Movie movie) {
        return movieMapper.select(movie);
    }

    @Override
    public int count(Map<String, Object> map) {
        return movieMapper.selectCount(map);
    }

    @Override
    public List<Movie> query(Map<String, Object> map) {
        return movieMapper.selectByPage(map);
    }
}
